<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <title>最美医生投票</title>
    <?php require 'templates/common/head.html'; ?>

    <style type="text/css">
        .divleft{width: 5%; float: left;min-height: 8px; text-align:center; border-right: solid 1px #d5d5d5; margin-right: 1% }
        .divleft2{width: 8%; min-width: 8%;min-height: 10px; float: left; text-align:center; border-right: solid 1px #d5d5d5; margin-right: 0% }
        .divright{ width: 8%; float:right; text-align: center;}
        .divleft3{ width: 10%; float: left; text-align:center;  border-right: solid 1px #d5d5d5; margin-right: 2% }

    </style>

</head>
<body>
<script src="../business/resource/js/jquery-1.11.1.min.js"></script>
<script language="JavaScript">
    function tuisong1(id){
        var oid=$("#oid").val();

        if(oid){
            var res = confirm("您确定给’"+oid+"’推送消息吗?");
        }else{
            var res = confirm("您确定给全部用户推送消息吗？");
        }
         if(res) {
             $.post('index.php?m=vote&a=ajax_send_phone',{'id':id,'oid':oid},function(data){
                 var res= eval('(' + data + ')');
                 alert(res.message);
             });
             alert("触发成功");
         }

    }
</script>
<div class="container-fluid">
    <?php require 'templates/common/nav.html'; ?>
    <div class="panel panel-primary">
        <div class="panel-heading text-center"><h3 class="panel-title">最美医生投票</h3></div>
        <div class="panel-body" style="font-size: 18px;">

            <a href="<?=$vote_add_url?>" type="button" class="btn btn-primary">添加投票医生</a>
            <a href="<?=$vote_leave_url?>" type="button" class="btn btn-primary">投票留言</a>
            <a href="<?=$send_message_url?>" type="button" class="btn btn-primary">发送短信</a>
            <a href="index.php?m=vote&a=export_vote" type="button" class="btn btn-primary">导出投票</a>
        </div>

        <div class=" text-right">
            测试openID: <input type="text" id="oid">
        </div>
        <div class="panel-body">
            <div class="panel-group"   id="accordion" role="tablist" aria-multiselectable="true">
                <div class="panel panel-default" >
                    <div class="panel-heading" style="background-color:#d5d5d5" >
                        <div class="row">
                            <div class="col-xs-4 text-justify" style="width:100%;">
                                <div class="divleft"><b >序号</b></div>
                                <div class="divleft"><b >姓名</b></div>
                                <div class="divleft2"><b  >头像</b></div>
                                <div class="divleft2"><b  >封面</b></div>
                                <div class="divleft"><b  >性别</b></div>
                                <div class="divleft"><b  >所在医院</b></div>

                                <div class="divleft"><b  >科室</b></div>
                                <div class="divleft"><b  >职称</b></div>

                                <div class="divleft"><b >联系方式</b></div>

                                <div class="divleft"><b >投票数</b></div>
                                <div class="divleft"><b >访问量</b></div>

                                <div class="divleft"><b  >状态</b></div>
                                <div class="divleft2"><b >发布日期</b></div>
                                <div class="divright"><b  >操作</b></div>

                            </div>
                        </div>
                    </div>
                </div>
                <div class="panel panel-default">
                    <?php foreach($vote_list as $key => $value):?>
                    <div class="panel-heading"  style=" <?php if($key%2==0){echo "background-color:#DFF0D8;";}else{ echo "border-top: solid 2px #ffffff;";}?>">
                    <div class="row">
                        <div class="col-xs-4 text-justify" style="width:100%;">

                            <div class="divleft"><span><?= $value['number'] ?></span></div>
                            <div class="divleft"><span><?= $value['name'] ?></span></div>
                            <div class="divleft2">
                                <img  width="60px" height="60px" src="<?=G_SITE_BASE?>/<?= $value['head_img'] ?>" title="<?=G_SITE_BASE?>/<?= $value['head_img'] ?>"/>
                            </div>
                            <div class="divleft2">
                                <img  width="60px" height="60px" src="<?=G_SITE_BASE?>/<?= $value['img'] ?>" title="<?=G_SITE_BASE?>/<?= $value['img'] ?>"/>
                            </div>

                            <div class="divleft"><span><?= $value['sex'] ?></span></div>
                            <div class="divleft"><span><?= $value['hospital'] ?></span></div>

                            <div class="divleft"><span><?= $value['keshi'] ?></span></div>
                            <div class="divleft"><span><?= $value['zhicheng'] ?></span></div>
                            <div class="divleft"><span><?= $value['dc_tel'] ?></span></div>

                            <div class="divleft"><span><?= $value['vote_num'] ?></span></div>
                            <div class="divleft"><span><?= $value['look_num'] ?></span></div>
                            <div class="divleft"><span><?php  echo  $value['state']==1?'已发布':'未发布' ?></span></div>
                            <div class="divleft2"><span><?= $value['release_date'] ?></span></div>
                            <div class="divright"><span> <a class="btn btn-primary btn-xs" href="<?=$vote_add_url?>&id=<?= $value['id']?>">编辑</a></span>


                                <button onclick="disabled=true;tuisong1('<?=$value['id']?>')" class="btn btn-primary btn-xs">推送</button>
                                <span> <a class="btn btn-primary btn-xs" href="<?=$vote_leave_url?>&id=<?= $value['id']?>">留言</a></span>
                                <span> <a class="btn btn-primary btn-xs" href="<?=$votenum_add_url?>&id=<?= $value['id']?>">加票</a></span>

                            </div>


                        </div>
                    </div>
                </div>
                <?php endforeach; ?>

            </div>
        </div>
    </div>
   <?= $page->showpage()?>
</div>

</div>

<?php require 'templates/common/foot.html'; ?>

</body>
</html>